<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel backend\models\EduEnterGiftsSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Edu Enter Gifts';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="edu-enter-gifts-index">

    <h1><?= Html::encode($this->title) ?></h1>
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <p>
        <?= Html::a('Create Edu Enter Gifts', ['create'], ['class' => 'btn btn-success']) ?>
    </p>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
//        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

//            'id',
//            'title',
            [
                'attribute' => 'title',
                'enableSorting' => false,
            ],
//            'poster',
//            'image',
            [
                'attribute' => 'image',
                'enableSorting' => false,
                'format' => ['image', [
                    'width' => '80',
                    'height' => '80',
                ]],
            ],
//            'gain_id',
            //'auth_id',
            //'desc',
            //'color_start',
            //'color_end',
            //'status',
//            'create_time:datetime',
            [
                'attribute' => 'create_time',
                'enableSorting' => false,
                'value' => function ($model) {
                    return date('Y-m-d', $model->create_time);
                }
            ],
            //'price',
            //'style',
            //'freight',
            //'rule:ntext',

            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>
</div>
